package com.zmj.sy.mom.srv.aps.bean.bo;

import com.zmj.sy.mom.srv.aps.bean.entity.resource.Station;
import com.zmj.sy.mom.srv.aps.utils.Comment;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.List;

@Getter
@Setter
public class ApsMachine extends ApsStep {

    private Integer id;

    private String name;

    private final Station station;

//    /** 日历的工作能力 */
//    private BigDecimal workingAbility;

    private List<ApsWeekDay> weekDays;


    @Comment("总工作时间 分钟")
    private Integer totalWorkTime;

    @Comment(value = "有效时长  分钟")
    private Integer validTime;


    public ApsMachine(Station station){
        this.id = station.getId();
        this.name = station.getName();
        this.station = station;
    }


    @Override
    public LocalDateTime getEndTime() {
        if(weekDays == null || weekDays.isEmpty()){
            return null;
        }
        return weekDays.get(0).getStartDateTime();
    }
}
